﻿//Created by Action Script Viewer - http://www.buraks.com/asv
package Classes {
    import Transactions.*;
    import Classes.util.*;

    public class Flag {

        protected const SECOND:int = 1000;
        protected const MINUTE:int = 60000;
        protected const HOUR:int = 3600000;
        protected const DAY:int = 86400000;
        protected const WEEK:int = 604800000;

        public var lastModifiedGlobalEngineTime:Number;
        public var name:String;
        public var m_value:Number;

        public function Flag(_arg1:String){
            this.name = _arg1;
            this.m_value = 0;
        }
        public static function buildFromServerObject(_arg1:Object):Flag{
            var _local2:Flag = new Flag(_arg1.name);
            _local2.value = _arg1.m_value;
            _local2.lastModifiedGlobalEngineTime = _arg1.lastModifiedGlobalEngineTime;
            return (_local2);
        }

        public function set value(_arg1:Number):void{
            this.lastModifiedGlobalEngineTime = GlobalEngine.getTimer();
            this.m_value = _arg1;
        }
        public function get value():Number{
            return (this.m_value);
        }
        public function getLastModifiedGlobalEngineTime():Number{
            return (this.lastModifiedGlobalEngineTime);
        }
        public function hasSecondsElapsed(_arg1:int):Boolean{
            if (!this.lastModifiedGlobalEngineTime){
                return (true);
            };
            var _local2:Number = (GlobalEngine.getTimer() - this.lastModifiedGlobalEngineTime);
            return ((_local2 > (this.SECOND * _arg1)));
        }
        public function hasDaysElapsed(_arg1:int):Boolean{
            if (!this.lastModifiedGlobalEngineTime){
                return (true);
            };
            var _local2:Number = (GlobalEngine.getTimer() - this.lastModifiedGlobalEngineTime);
            return ((_local2 > (this.DAY * _arg1)));
        }
        public function setAndSave(_arg1:Number):void{
            this.value = _arg1;
            GameTransactionManager.addTransaction(new TFlag(this.name, _arg1));
        }

    }
}//package Classes 
